// Copyright (C) joyinter
// All rights reserved.
// 
// Author : Jiang Li
// Date   : 2004-6-4

#ifndef __AES_H_NETMSG__
#define __AES_H_NETMSG__

#pragma once

#include <windows.h>

//##ModelId=44C4B5FD01B5
class CJoyAes
{
protected:
	//##ModelId=44C4B5FD01EA
    class SContext
    {
    public:
		//##ModelId=44C4B5FD01F4
	    INT key_length;
		//##ModelId=44C4B5FD01F5
	    DWORD E[60];
		//##ModelId=44C4B5FD01F6
	    DWORD D[60];
    };
	//##ModelId=44C4B5FD01B7
    SContext    m_Context;
public:
	//##ModelId=44C4B5FD01C5
    CJoyAes(void* pKey = NULL, UINT nSize = 0);
	//##ModelId=44C4B5FD01C8
    virtual ~CJoyAes(){}

	//##ModelId=44C4B5FD01CA
    virtual const UINT* GetLegalKeySizes();
	//##ModelId=44C4B5FD01CC
    virtual UINT GetBlockSize();
	//##ModelId=44C4B5FD01CE
    virtual UINT GetKeySize();
	//##ModelId=44C4B5FD01D5
    virtual bool SetKey(void* pKey, UINT nSize);
    
	//##ModelId=44C4B5FD01D9
    virtual bool Encrypt(PVOID pOut, LPCVOID pIn, size_t nSize);
	//##ModelId=44C4B5FD01E5
    virtual bool Decrypt(PVOID pOut, LPCVOID pIn, size_t nSize);
};

#endif  // __AES_H_NETMSG__
